package com.lbz.converter;

import com.lbz.entity.Product;
import com.lbz.utils.PropertiesUtil;
import com.lbz.vo.ProductListVO;

/**
 * @Author 林必昭
 * @Date 2019/6/15 14:29
 */


public class Product2ProductListVOConverter {

    public static ProductListVO convert(Product product){

        ProductListVO productListVO = new ProductListVO();
        productListVO.setId(product.getId());
        productListVO.setCategoryId(product.getCategoryId());
        productListVO.setName(product.getName());
        productListVO.setMainImage(product.getMainImage());
        productListVO.setPrice(product.getPrice());
        productListVO.setSubtitle(product.getSubtitle());
        productListVO.setStatus(product.getStatus());
        productListVO.setImageHost(PropertiesUtil.getProperty("ftp.server.http.prefix","http://img.happymlbz.com/"));
        return productListVO;
    }
}
